/*
 * @Description: * 
 * @Date: 2020-08-26 15:42:17
 * @LastEditTime: 2020-08-26 19:21:08
 * @Author: SBD
 * @FilePath: /cms/src/router/index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)


const routes = [
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    meta: {
      title: '首页',
      icon: 'plane'
    },
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login/login.vue'),
    meta: {
      title: '登录页',
    }
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import('../views/About.vue'),
    meta: {
      title: '测试',
    }
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
